String | Replacement value |
@CID | cursor ID |
@XVAL | active cursor X position |
@YVAL | active cursor Y position |
@ZVAL | Z value at cursor index position |
@XY | same as complex(@XVAL,@YVAL) |
@IDX | active cursor index |
@HAND | handle of active trace |
@LNUM | line number of active trace |
@Q1 | getappdata(gcf,'Q1') |
@Q2 | getappdata(gcf,'Q2') |
@Q3 | getappdata(gcf,'Q3') |
@Q4 | getappdata(gcf,'Q4') |
@V1 | getappdata(gcf,'V1') |
@V2 | getappdata(gcf,'V2') |
@V3 | getappdata(gcf,'V3') |
@V4 | getappdata(gcf,'V4') |
math folder: | airspeed, carlo, curves, gpsLog |
sig folder: | afiltALT, editz, erip |
Notes: | The cid (cursor ID) that appears in all the commands shown below is an
integer that identifies the cursor the command is to act on. This integer is returned from the cursor
initialization command used to create the cursor. If an axis contains a cursor, its cid is saved in
the axis user data. (The cid stored in the axis user data is always a scalar since an axis may only
contain a single cursor object.) You can specify that the cid should be retrieved from the axis user
data by specifying a zero for the cid. So for example the following two commands have the same effect:
cur(0,'visON') cur(get(gca,'user'),'visON') |
Although cid is usually specified as a number, you may also specify it as
a decimal character string. This allows many of the cursor function calls to use the Matlab command syntax.
For example, these three lines have the same effect: cur(1,'visON') cur('1','visON') cur 1 visON |
|
The figure 'cid' application data variable contains a vector with the
cursor IDs for all the cursor objects in the figure. You can specify that the cid should be
retrieved from this vector by supplying a negative number as the cid (for example -2 specifies
the 2nd element of this vector). This means that the following two lines have the same effect:
xy=cur(-2,'get'); c=getappdata(gcf,'cid'); xy=cur(c(2),'get'); |
|
All the following commands are case-sensitive (unlike all the other plt parameters previously described) and must use the exact case shown below. | |
All the cursor commands below may return up to two arguments. If the return arguments are listed for a cursor command, the return values will be as specified. However if the return arguments are not listed for a particular command, the first return value (if requested) will be the active cursor handle and the second return value (if requested) will be the active line handle. | See the following programs for examples of the use of the cursor commands described below:
|
1: x label | 5: y cursor readout | 09: marker/linestyle button | 13: main (left) axis |
2: y label | 6: y cursor expansion | 10: delta button | 14: right hand axis (0 if none) |
3: x cursor readout | 7: peak button | 11: expansion box | 15: current cursor marker |
4: x cursor expansion | 8: valley button | 12: delta cursor | 16: TraceID axis (0 if none) |
u = cur(cid,'expHis');
Returns an array containing the display expansion history.
Each row contains one display expansion as [xmin, xmax, ymin, ymax, code] where:
cur(cid,'visON');
cur(cid,'visOFF');
Shows or hides the following objects:
Note that this function is invoked alternately (visOFF/visON) when you right-click on the plot y-axis label (which also hides/shows the menu box).
cur(cid,'aux','on');cur(cid,'setObjPos',p);
Sets the cursor object positions to p, where p is a 9 by 4 element array. Each row contains (x,y,width,height)
which represents the position and size of the following objects:
Note that this command does not set the position of the optional x-axis
control slider. However you can set this position using the plt 'xy'
parameter, or with a command such as:
set(findobj(gcf,'tag','xslider'),'position',p);
mode | action |
'UpDown' | Allows the edit cursor point to move only in the y-axis direction.
Only the first character of the mode parameter is used, so 'UpDown'
is equivalent to 'UD', or just 'u'.
This command has a similar effect to right clicking on the last selection in the popup
menu shown below (except that action toggles this persistent data editing mode on or off).
See the |
'LeftRight' | Allows the edit cursor point to move only in the x-axis direction. Equivalent to 'lr' or 'L' for example. |
'Both' | Allows the edit cursor point to move in both the x and y directions. Equivalent to 'B' or 'b' for example. |
'Off' |
Turns off any persistent editing mode that was initiated by one of the above 'Emode'
commands or that was initiated by right clicking any of the bottom three selections of the popup menu shown
at the right. (Note: This is the popup that appears when you right click on the Ycursor edit box. Again, see the
Equivalent to 'O' or 'o' for example. See the editz.m, erip.m, and hermite.m applications for examples of the use of the cursor Emode commands. |
plt cleft 0 ZoomOut; | Zoom out both x & y axis by 40%. |
Zoom in both x & y axis by 40%. With the functional form (which applies to the command above as well), you may also include an additional argument that specifies the zoom ratio. For example, this command specifies a 20% ratio (half of the default amount): |
|
plt cleft 0 peakval 0; | Move the cursor to the next peak. (The last argument may be omitted in this case.) |
plt cleft 0 peakval 1; | Move the cursor to the next valley |
plt cleft 0 peakval 2; | Reset the peak finder (i.e. move the cursor to the highest peak) |
plt cleft 0 peakval 3; | Reset the valley finder (i.e. move the cursor to the lowest valley) |
plt cleft 0 TGLlogy; | Toggle the y-axis between linear/log |
plt cleft 0 TGLlogx; | Toggle the x-axis between linear/log |
plt cright 0 TGLlogy; | Open Hardcopy menu |
plt cright 0 TGLlogx; | Swap x & y axes |
plt cleft 0 markCB; | Toggle the delta cursor mode on or off |
plt cleft 0 mlsCB; | 3-way toggle of all traces between markers only, lines only, and both lines & markers |
plt cleft 0 mark; | Adds a text label identifying the current cursor location |
plt xleft TGLgrid; | Toggle between grid lines and ticks |
plt xright TGLgrid; | Toggle between default and alternate grid style |
plt xleft data; | Open a cursor data window |
plt xright data; | Toggle the menu bar on/off |
plt xleft mark 2; | Open a window allowing editing plt figure colors |
plt xleft mark 3; | Write a file saving the current plt figure colors |
plt xleft link; | Toggle right hand axis link status |
plt xleft RMS; | Equivalent to clicking on the cursorID tag which rotates between the five cursor modes [normal, Avg, RMS, y/x, sqrt(x^2+y^2)]. After five of these commands the cursor mode will be the same as it was before the first of those commands (having rotated thru all the modes). |
plt xleft EDIT 1; | Enter data editing (using last used editing mode) |
plt xleft EDIT 2; | Open up Yedit popup menu |
plt xleft EDIT 5; | Exit data editing mode |
plt xleft Yedit 1; | Open a window allowing editing the line properties of cursored trace.
(The command |
plt xright Yedit 1; | Open a window allowing editing the plt figure properties |
plt xleft Yedit 2; | Toggle multiCursor mode |
plt xleft Yedit 3; | Toggle xView slider |
plt xleft Yedit 4; | Cancel data editing mode |
plt xleft Yedit 5; | Enter data edit mode (Range) |
plt xleft Yedit 6; | Enter data edit mode (Range left/right) |
plt xleft Yedit 7; | Enter data edit mode (Range up/down) |
plt xleft Yedit 8; | Enter data edit mode (Modify) |
plt xleft Yedit 9; | Enter data edit mode (Modify left/right) |
plt xleft Yedit 10; | Enter data edit mode (Modify up/down) |
plt xright Yedit 8; | Toggle persistent data edit mode (Modify) |
plt xright Yedit 9; | Toggle persistent data edit mode (Modify left/right) |
plt xright Yedit 10; | Toggle persistent data edit mode (Modify up/down) |
where:
Row | [x y w h] |
1 | label for x cursor readout |
2 | label for y cursor readout |
3 | x cursor readout |
4 | x cursor expansion |
5 | y cursor readout |
6 | y cursor expansion |
7 | peak find button |
8 | valley find button |
9 | line markers button |
10 | delta cursor button |
11 | x-axis cursor slider (optional) |
Row | [r g b] |
1 | x/y cursor label color |
2 | cursor readout color [*1] |
3 | expansion box color |
4 | delta cursor color |
5 | line #1 cursor color [*1] |
6 | line #2 cursor color [*1] |
... | ............................... [*1] |
4+n (Must have a row for each line object that has a cursor) | line #n cursor color [*1] |
Notes: |
When the cur('init' function is called, plt will attempt to add cursors to all lines of the axis created by plt. If you want plt to skip adding cursors to some of the lines, you should tag the line with the string 'SkipCur'. For example, a cursor would not be created for a line created with the following command: line(x,y,'tag','SkipCur'); |
Another way to restrict which lines are to be cursored is to add the application data key 'Lhandles' to the axis. (For example: setappdata(ax,'Lhandles',[h1 h3]); would tell the cursor initialization routine to add cursors only to those two handles.) |